<template>
	<div class="page dealEmergencyApply-page" data-page="dealEmergencyApply" style="z-index: 2;">
		<div class="link-page-nav">
			<a href="#" class="link" @click=$root.backToTab()>
				<i class="iconfont icon-zuo"></i>
			</a>
		</div>
		<div class="link-page-top" style="padding-bottom: 17px;">
			<div class="link-page-title">应急救援</div>
			<a href="/emergencyList/" class="link">
				<i class="iconfont icon-APPicon_lishi" style="font-size: 23px;"></i>
			</a>
		</div>
		<div class="page-content" style="padding-bottom: 120px;">
			<div class="toolbar toolbar-fixed deal-toolbar-self" id="deal-toolbar_{{getNewId}}">
				<div class="toolbar-inner emergencyTab-self" id="emergencyTab_{{getNewId}}"></div>
			</div>
			<div class="tabs emergency-tab" class="emergencyTabContent-self" id="emergencyTabContent_{{getNewId}}"
				style="margin-top: 50px;"></div>
		</div>
	</div>
</template>
<style>
	/* 应急救援 */
	.dealEmergencyApply-page .emergencyPlanGroup-content img {
		width: initial !important;
		max-width: 100%;
	}

	.emergencyPlanGroup-content {
		display: none;
	}

	.dealEmergencyApply-page .weizhi:after {
		height: 0px;
	}

	.dealEmergencyApply-page .weizhiul:after {
		height: 0px;
	}

	.dealEmergencyApply-page .emergencyTab-self a {
		font-size: 14px;
		height: 30px;
		margin: 0 10px;
	}

	.dealEmergencyApply-page .emergencyTab-self {
		width: 100%;
		display: flex;
		justify-content: flex-start;
		align-items: center;
	}

	.dealEmergencyApply-page .emergencyTab-self a {
		color: #999999 !important;
		margin: 0;
		margin-right: 20px;
		font-size: 14px;
	}

	.dealEmergencyApply-page .emergencyTab-self .tab-link-active {
		font-size: 16px;
		font-weight: bold;
		border-bottom: 3px solid #333;
		box-sizing: border-box;
		color: #333 !important;
	}

	.dealEmergencyApply-page .emergencyTabContent-self .list {
		margin-top: 0px;
		margin-bottom: 0px;
	}

	.dealEmergencyApply-page .emergencyTabContent-self .list ul:after {
		height: 0px;
	}

	.dealEmergencyApply-page .emergencyTabContent-self .block-title {
		margin-top: 10px;
		font-size: 15px;
		font-weight: bold;
		margin-bottom: 0px;
	}

	.dealEmergencyApply-page .emergencyTabContent-self .block p {
		margin: 0px;
		padding-bottom: 5px;
		font-size: 14px;
	}

	.dealEmergencyApply-page .emergencyTabContent-self .block {
		margin-bottom: 20px;
	}

	.dealEmergencyApply-page .emergencyPlan-self .block-title {
		color: #0e588c;
		margin-bottom: 6px;
		font-weight: lighter;
	}

	.dealEmergencyApply-page .emergencyPlan-self p {
		margin-top: 0px !important;
	}

	.dealEmergencyApply-page .emergencyPlan-self .row {
		width: 100%;
		font-size: 14px;
		padding-left: 16px;
		padding-right: 16px;
		margin-bottom: 5px;
	}

	.dealEmergencyApply-page .emergencyPlan-self .row .gropList {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.dealEmergencyApply-page .deal-toolbar-self {
		box-shadow: none !important;
	}

	.dealEmergencyApply-page .weizhiul .accordion-item .item-inner {
		line-height: 1.7;
	}
</style>
<script>
	let tempData;
	let tempMap;
	return {
		data: function () {
			return {
				dataList: [],
				planMap: null,
				firePoint: null,
				getNewId: (new Date()).getTime()
			}
		},
		mounted() {

		},
		methods: {
			getEmergencyData: function () {
				common.loading(1);
				let self = this;
				let $ = self.$;
				let id_org = "";
				if (single_Orgid) {
					id_org = single_Orgid;
				} else {
					id_org = userInfor.organizationIds;
				}
				Dao.getEmergency({
					//orgIds:userInfor.organizationIds,"122,152"
					orgIds: id_org,
					status: 1,
				}, function (data) {
					if (data && data.length > 0) {
						$("#emergencyTab_" + self.getNewId + ",#emergencyTabContent_" + self.getNewId).empty();
						for (let i = 0; i < data.length; i++) {
							$("#emergencyTab_" + self.getNewId).append(`<a href="#emergency-tab-` + data[i].id + `_` + self
								.getNewId + `" id="tab` +
								data[i].id + `_` + self.getNewId + `" class="tab-link">` + common.transNullundefined(data[i]
									.orgName).toString() + `</a>`);
							$("#emergencyTabContent_" + self.getNewId).append(`
                            <div id="emergency-tab-` + data[i].id + `_` + self.getNewId + `" class="emergency-tab-content tab">
                                <div class="list">
									<div class="list accordion-list"  id="showFmapByOrg` + data[i].id + `_` + self.getNewId + `">
										<div class="yj-map">
											<div id="drawBmap_` + data[i].id + `_` + self.getNewId + `" style="height:200px;"></div>
											<div class="yj-map-bot">
												<div class="yj-map-bot-t" style="position:relative">
													<div class="yj-map-bot-t-r">
														<i class="iconfont icon-weibiaoti-_huozaigaoweidanweitubiao"></i>
														<span>着火点</span>
													</div>	
													<span id="goToPoint_` + data[i].id + `_` + self.getNewId + `" style="margin-right:10px">
														立即前往
													</span>
													<i class="iconfont icon-youjiantoushixinxiao" style="font-size:36px;color:#2471CA ; position: absolute;right: -20px; top: 0;"></i>
												</div>
												<div class="location">位置：` + common.transNullundefinedToline(data[i].location) + `</div>
											</div>
											<div class="" style="float:right;   border-color: transparent #2471CA transparent transparent;">
											
										</div>
										<div class="yjya-basic" id="planBasic_` + data[i].id + `_` + self.getNewId + `"></div>
                                        <ul id="weizhiul" class="weizhiul">
                                            <li class="accordion-item">
												<div class="item-inner weizhi" id="weizhi" style="margin: 0 20px;margin-bottom: 20px;">
													<div class="item-title">
														<b style="color: #E07762;font-size: 17px;">应急预案</b>
														</br>
														<b style="color: #333333;font-size: 17px;">` + common.transNullundefined(data[i].planName) +
								`</b>
													</div>
												</div>
                                            </li>
                                        </ul>
                                    </div>
                                    <div class="block-title" style="color: #222222;font-size:16px;padding-left: 5px;font-weight:bold;display:none;" id="deal_video` +
								data[i].id + `_` + self.getNewId +
								`" ><i class="iconfont icon-youjiantoushixinxiao" style="font-size:36px;vertical-align: middle; margin-left: -10px;"></i>
								<span style="display:inline-block;vertical-align:middle;margin-left: -10px;">附近监控</span><div style="margin-left: 10px;font-size: 12px;color: #666666;display:inline-block" id="num` +
								data[i].id + `_` + self.getNewId + `"></div></div>
                                    <div class="block emergencyVedio-list-` + data[i].id + `" id="emergencyVideo` +
								data[i].id + `_` + self.getNewId +
								`" style="display:none"></div>
                                    <div class="divide-gray mt98" style="margin-top: 0px;display: none;" id="hideInfo1_"` + self.getNewId + `></div>
                                    <div class="block emergencyPlan-self" id="emergencyPlan" style="padding: 0px;margin:0px">
										<div class="block-title" id="groupHead` + data[i].id + `_` + self.getNewId + `" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;">
											<i class="iconfont icon-youjiantoushixinxiao" style="font-size:36px;vertical-align: middle; margin-left:-10px"></i>
											<span style="display:inline-block;vertical-align:middle;margin-left: -10px;">应急人员</span></div>
                                        <div class="row" id="emergencyPlanGroup_list_` + data[i].id + `_` + self
								.getNewId + `"></div>
                                        <div class="emergencyPlanProse" style="background-color:#f6fafc00;margin: 0px;">
											<div class="block-title" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;">
												<i class="iconfont icon-youjiantoushixinxiao" style="font-size:36px;vertical-align: middle; margin-left:-10px"></i>
												<span style="display:inline-block;vertical-align:middle;margin-left: -10px;">处置流程</span></div>
                                            <div class="emergencyPlanProse-content" id="planProse` + data[i].id + `_` +
								self.getNewId + `">
                                            </div>
                                           
											<div class="block-title block-titleClick" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;"><div style="width:6px;height: 6px;border-radius:50%;background:#4699FF;display: inline-block;vertical-align:middle"></div> 
											<span style="display:inline-block;vertical-align:middle;">现场指挥小组分工</span><i class="iconfont icon-xiala" style="float: right;color: #999999"></i> </div>
											<div class="emergencyPlanGroup-content" id="planGroup1` + data[i].id + `_` + self.getNewId + `">
                                            </div>
                                            <div class="block-title block-titleClick" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;"><div style="width:6px;height: 6px;border-radius:50%;background:#4699FF;display: inline-block;vertical-align:middle"></div> 
											<span style="display:inline-block;vertical-align:middle;">信息传导小组分工</span><i class="iconfont icon-xiala" style="float: right;color: #999999"></i> </div>
                                            <div class="emergencyPlanGroup-content" id="planGroup2` + data[i].id +
								`_` + self.getNewId + `">
                                            </div>
											<div class="block-title block-titleClick" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;"><div style="width:6px;height: 6px;border-radius:50%;background:#4699FF;display: inline-block;vertical-align:middle"></div>
											<span style="display:inline-block;vertical-align:middle;">灭火战斗小组分工</span><i class="iconfont icon-xiala" style="float: right;color: #999999"></i> </div>
                                            <div class="emergencyPlanGroup-content" id="planGroup3` + data[i].id +
								`_` + self.getNewId + `">
                                            </div>
											<div class="block-title block-titleClick" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;"><div style="width:6px;height: 6px;border-radius:50%;background:#4699FF;display: inline-block;vertical-align:middle"></div> 
											<span style="display:inline-block;vertical-align:middle;">引导疏散小组分工</span><i class="iconfont icon-xiala" style="float: right;color: #999999"></i> </div>
                                            <div class="emergencyPlanGroup-content" id="planGroup4` + data[i].id +
								`_` + self.getNewId + `">
                                            </div>
											<div class="block-title block-titleClick" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;"><div style="width:6px;height: 6px;border-radius:50%;background:#4699FF;display: inline-block;vertical-align:middle"></div>
											<span style="display:inline-block;vertical-align:middle;">安全警戒小组分工</span><i class="iconfont icon-xiala" style="float: right;color: #999999"></i> </div>
                                            <div class="emergencyPlanGroup-content" id="planGroup5` + data[i].id +
								`_` + self.getNewId + `">
                                            </div>
											<div class="block-title block-titleClick" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;"><div style="width:6px;height: 6px;border-radius:50%;background:#4699FF;display: inline-block;vertical-align:middle"></div>
											<span style="display:inline-block;vertical-align:middle;">后勤救护小组分工</span><i class="iconfont icon-xiala" style="float: right;color: #999999"></i> </div>
                                            <div class="emergencyPlanGroup-content" id="planGroup6` + data[i].id +
								`_` + self.getNewId + `">
                                            </div>
											<div class="block-title block-titleClick" style="color:#222222;margin-top:10px;padding-left: 5px;font-weight:bold;"><div style="width:6px;height: 6px;border-radius:50%;background:#4699FF;display: inline-block;vertical-align:middle"></div> 
											<span style="display:inline-block;vertical-align:middle;">其他小组分工</span><i class="iconfont icon-xiala" style="float: right;color: #999999"></i> </div>
                                            <div class="emergencyPlanGroup-content" id="planGroup` + data[i].id + `_` +
								self.getNewId + `">
                                            </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="lastBut">
                        			<div class="btuInfo" id="closeFire` + data[i].id + `_` + self.getNewId + `">结束火情</div>
                        		</div>
                                </div>
                        `);
							jQuery("#closeFire" + data[i].id + `_` + self.getNewId).off().on("click", {
								'data': data[i].id
							}, function (e) {
								self.tipsDialogInfo("你确认结束本次火情吗？", "确定", "不了，再想想", function () {
									self.quitGetTaskEnd(e.data.data);
									layer.closeAll();
								}, null);
								e.stopPropagation(); //停止事件冒泡
							});
							/* self.selectEmergencyPlanRecordsDetail(data[i].id);
							self.selectEmergencyPlanDetail(data[i].planId,data[i].id); */

							jQuery("#tab" + data[i].id + `_` + self.getNewId).off().on("click", {
								'id': data[i].id,
								'planId': data[i].planId,
							}, function (e) {
								if (!getClickEnabel()) return
								let id = e.data.id;
								let planId = e.data.planId;
								self.selectEmergencyPlanRecordsDetail(id);
								self.selectEmergencyPlanDetail(planId, id);
							});
							//立即前往
							jQuery("#goToPoint_" + data[i].id + `_` + self.getNewId).off('click').click(function () {
								self.fixFirePosition()
							});
						}
						self.selectEmergencyPlanRecordsDetail(data[0].id);
						self.selectEmergencyPlanDetail(data[0].planId, data[0].id);
						jQuery("#emergencyTab_" + self.getNewId + " a").eq(0).addClass('tab-link-active');
						jQuery("#emergencyTabContent_" + self.getNewId + " .emergency-tab-content").eq(0).addClass(
							'tab-active');
						/*jQuery(".emergencyVedio-list-click").click(function (event) {
							let vedioId = this.id;
						});*/
						jQuery("#emergencyTabContent_" + self.getNewId + " .emergency-tab-content").on('tab:show', function (
						e) {
							$(".page-content").scrollTop(0, 300);
						});
						//箭头点击事件
						jQuery('.block-titleClick').click(function () {
							if (jQuery('i', this).hasClass('icon-xiala')) {
								jQuery('i', this).addClass('icon-shouqi').removeClass('icon-xiala')
								jQuery(this).next('.emergencyPlanGroup-content').stop().slideDown()
							} else {
								jQuery('i', this).removeClass('icon-shouqi').addClass('icon-xiala')
								jQuery(this).next('.emergencyPlanGroup-content').stop().slideUp()
							}
						})

					} else {
						//暂无数据
						//$("#divider-line").hide();
						$("#deal-toolbar_" + self.getNewId).hide();
						$("#emergencyTabContent_" + self.getNewId).append(`<div class="no-data-img"><img src="` +
							listNoDataPic() + `"/></div>`);

					}
					common.loading(0);
				});
			},
			//获取小组相关负责人
			selectEmergencyPlanRecordsDetail: function (id) {
				let self = this;
				let $ = self.$;
				Dao.selectEmergencyPlanRecordsDetail({
					recordId: id,
				}, function (peoData) {
					self.drowBmap(peoData.lon, peoData.lat, id);
					//小组相关负责人
					let peoDatalist = peoData.members;
					if (peoDatalist && peoDatalist.length > 0) {
						$("#emergencyPlanGroup_list_" + id + "_" + self.getNewId).empty();
						for (let n = 0; n < peoDatalist.length; n++) {
							$("#emergencyPlanGroup_list_" + id + "_" + self.getNewId).append(`
                                <div class="row" style="padding-left: 10px;margin-top:10px">
                                    <div class="gropList col-40">` + common.transNullundefined(peoDatalist[n]
									.groupName) + `</div>
                                    <div class="gropList col-20">` + common.transNullundefined(peoDatalist[n]
								.dutyName) + `</div>
									<div class="gropList col-40">` + (peoDatalist[n].tel ?
									`<span class= "tel" ontouchstart = "return false;" onclick = "window.location='tel:` +
									peoDatalist[n].tel + `'" > ` + peoDatalist[n].tel + `</span>` : '') + `</div>
                                </div>
                            `);
						}
						$("#emergencyVideo" + id + "_" + self.getNewId).empty();
						if (peoData.videoInfo && peoData.videoInfo.length > 0) {
							/* videoData[data[i].videoInfo.id] = data[i].videoInfo; */
							let videoData = [];
							$("#deal_video" + id + "_" + self.getNewId).show();
							$("#hideInfo1_" + self.getNewId).show();
							$("#emergencyVideo" + id + "_" + self.getNewId).show();
							let DFVideoIcon = "";
							let status = "";
							$("#num" + id + "_" + self.getNewId).html("有" + peoData.videoInfo.length + "路视频");
							for (let i = 0; i < peoData.videoInfo.length; i++) {
								let vedioObj = peoData.videoInfo[i].video;
								videoData[peoData.videoInfo[i].id] = peoData.videoInfo[i];
								if (!peoData.videoInfo[i].picUrl && peoData.videoInfo[i].picUrl == "") {
									DFVideoIcon = staticPath + "img/vedio/defaultVideo.png";
								} else {
									DFVideoIcon = peoData.videoInfo[i].picUrl;
								}
								if (peoData.videoInfo[i].isOnline == 1) {
									status = staticPath + "img/vedio/play.png"
								}
								if (peoData.videoInfo[i].isOnline == 0) {
									status = staticPath + "img/vedio/offline.png"
								}
								$("#emergencyVideo" + id + "_" + self.getNewId).append(`
                                <div class="videoli" id=videoli` + common.transNullundefined(peoData.videoInfo[i].id) +
									`_` + self.getNewId + `>
                                      <img class="vedioImg" id=img_` + common.transNullundefined(peoData.videoInfo[i]
										.id) + `_` + self.getNewId + ` src=` + DFVideoIcon +
									` onerror="this.onerror=null; this.src='` + picVedioNo() + `'">
                                      <div class="status_div" id= status_` + common.transNullundefined(peoData
										.videoInfo[i].id) + `_` + self.getNewId + `>
                                          <img class="div_status" src=` + status + ` >
                                      </div>
                                </div>`);
								//视频播放
								jQuery('#status_' + common.transNullundefined(peoData.videoInfo[i].id) + '_' + self.getNewId).off(
									"click").on("click", {
									'data': peoData.videoInfo[i].id
								}, function (e) {
									let id = e.data.data;
									let bean = videoData[id];
									let videoBean = {};
									videoBean.id = bean.id;
									videoBean.deviceId = bean.deviceId;
									videoBean.type = bean.type;
									videoBean.name = bean.name;
									videoBean.channel = bean.channel;
									videoBean.status = bean.status;
									videoBean.picUrl = bean.picUrl;
									videoBean.isOnline = bean.isOnline;
									videoBean.isConcem = bean.isConcem == null ? 0 : bean.isConcem;
									common.loading(1);
									Dao.getAuthList({
										userName: userInfor.accountName,
										deviceId: appKeyObj.deviceId,
										organizationId: bean.organizationId,
										equiptType: bean.type,
										orgCode: userInfor.org.orgCode,
										authId: bean.authId
									}, function (data) {
										common.loading(0);
										let videoKeyBean = data[0];
										native.openVideo(JSON.stringify(videoKeyBean), JSON
											.stringify(videoBean));
									}, function (e) {
										common.loading(0);
										app.methods.showToastBottom('播放视频失败');
									});
								});
							}
						}
					} else {
						$("#groupHead" + id + '_' + self.getNewId).hide();
					}
					$("#planBasic_" + id + '_' + self.getNewId).html(`
						<div class="title">基本信息</div>
						<div class="basic">
							<div class="list">
								<div class="left">单位名称</div>	
								<div class="right">` + common.transNullundefinedToline(peoData.orgName) + `</div>	
							</div>
							<div class="list">
								<div class="left">单位地址</div>	
								<div class="right">` + common.transNullundefinedToline(peoData.address) + `</div>	
							</div>
							<div class="list">
								<div class="left">安全责任人</div>	
								<div class="right">` + common.transNullundefinedToline(peoData.safeDutyName) +
						(peoData.safeDutyPhone ?
							`<span class= "tel" ontouchstart = "return false;" onclick = "window.location='tel:` + peoData
							.safeDutyPhone + `'" > ` + peoData.safeDutyPhone + `</span>` : '') +
						`</div>	
							</div>
							<div class="list">
								<div class="left">安全管理人</div>	
								<div class="right">` + common.transNullundefinedToline(peoData.safeManagerName) +
						(peoData.safeManagerPhone ?
							`<span class= "tel" ontouchstart = "return false;" onclick = "window.location='tel:` + peoData
							.safeManagerPhone + `'" > ` + peoData.safeManagerPhone + `</span>` : '') +
						`</div>	
							</div>
							<div class="list">
								<div class="left">发生时间</div>	
								<div class="right">` + common.transNullundefinedToline(peoData.storageTime) + `</div>	
							</div>
							<div class="list">
								<div class="left">持续时间</div>	
								<div class="right">` + common.transNullundefinedToline(peoData.continueTime) + `</div>	
							</div>
						</div>`);
				});
			},
			//获取预案流程和小组分工
			selectEmergencyPlanDetail: function (planId, id) {
				let self = this;
				Dao.selectEmergencyPlanDetail({
					planId: planId,
				}, function (planData) {
					$("#planProse" + id + "_" + self.getNewId).html(common.transNullundefined(planData.flowContent));
					$("#planGroup" + id + "_" + self.getNewId).html(common.transNullundefined(planData.taskContent));
					$("#planGroup1" + id + "_" + self.getNewId).html(common.transNullundefined(planData.leaderTaskContent));
					$("#planGroup2" + id + "_" + self.getNewId).html(common.transNullundefined(planData
						.conductionTaskContent));
					$("#planGroup3" + id + "_" + self.getNewId).html(common.transNullundefined(planData.battleTaskContent));
					$("#planGroup4" + id + "_" + self.getNewId).html(common.transNullundefined(planData
					.evacuateTaskContent));
					$("#planGroup5" + id + "_" + self.getNewId).html(common.transNullundefined(planData
						.safetyalertTaskContent));
					$("#planGroup6" + id + "_" + self.getNewId).html(common.transNullundefined(planData
						.logisticsTaskContent));
					let flag = false
					if (planData.leaderTaskContent == '') {
						$("#planGroup1" + id + "_" + self.getNewId).hide()
						$("#planGroup1" + id + "_" + self.getNewId).prev('.block-title').hide()
					} else {
						if (!flag) {
							$("#planGroup1" + id + "_" + self.getNewId).show()
							$("#planGroup1" + id + "_" + self.getNewId).prev('.block-title').find('i').addClass('icon-shouqi')
								.removeClass('icon-xiala')
							flag = true
						}
					}
					if (planData.conductionTaskContent == '') {
						$("#planGroup2" + id + "_" + self.getNewId).hide()
						$("#planGroup2" + id + "_" + self.getNewId).prev('.block-title').hide()
					} else {
						if (!flag) {
							$("#planGroup2" + id + "_" + self.getNewId).show()
							$("#planGroup2" + id + "_" + self.getNewId).prev('.block-title').find('i').addClass('icon-shouqi')
								.removeClass('icon-xiala')
							flag = true
						}
					}
					if (planData.battleTaskContent == '') {
						$("#planGroup3" + id + "_" + self.getNewId).hide()
						$("#planGroup3" + id + "_" + self.getNewId).prev('.block-title').hide()
					} else {
						if (!flag) {
							$("#planGroup3" + id + "_" + self.getNewId).show()
							$("#planGroup3" + id + "_" + self.getNewId).prev('.block-title').find('i').addClass('icon-shouqi')
								.removeClass('icon-xiala')
							flag = true
						}
					}
					if (planData.evacuateTaskContent == '') {
						$("#planGroup4" + id + "_" + self.getNewId).hide()
						$("#planGroup4" + id + "_" + self.getNewId).prev('.block-title').hide()
					} else {
						if (!flag) {
							$("#planGroup4" + id + "_" + self.getNewId).show()
							$("#planGroup4" + id + "_" + self.getNewId).prev('.block-title').find('i').addClass('icon-shouqi')
								.removeClass('icon-xiala')
							flag = true
						}
					}
					if (planData.safetyalertTaskContent == '') {
						$("#planGroup5" + id + "_" + self.getNewId).hide()
						$("#planGroup5" + id + "_" + self.getNewId).prev('.block-title').hide()
					} else {
						if (!flag) {
							$("#planGroup5" + id + "_" + self.getNewId).show()
							$("#planGroup5" + id + "_" + self.getNewId).prev('.block-title').find('i').addClass('icon-shouqi')
								.removeClass('icon-xiala')
							flag = true
						}
					}
					if (planData.logisticsTaskContent == '') {
						$("#planGroup6" + id + "_" + self.getNewId).hide()
						$("#planGroup6" + id + "_" + self.getNewId).prev('.block-title').hide()
					} else {
						if (!flag) {
							$("#planGroup6" + id + "_" + self.getNewId).show()
							$("#planGroup6" + id + "_" + self.getNewId).prev('.block-title').find('i').addClass('icon-shouqi')
								.removeClass('icon-xiala')
							flag = true
						}
					}
					if (planData.taskContent == '') {
						$("#planGroup" + id + "_" + self.getNewId).hide()
						$("#planGroup" + id + "_" + self.getNewId).prev('.block-title').hide()
					} else {
						if (!flag) {
							$("#planGroup" + id + "_" + self.getNewId).show()
							$("#planGroup" + id + "_" + self.getNewId).prev('.block-title').find('i').addClass('icon-shouqi')
								.removeClass('icon-xiala')
							flag = true
						}
					}
					$("#planGroup" + id + "_" + self.getNewId).off('click').on('click', function () {
						let picUrl = $(this).find('p img').attr('src')
						openAndShowBigImage([picUrl]);
					})
				}, function (e) {
					common.loading(0);
					app.methods.showToastBottom('获取预案流程失败');
				});
			},
			tipsDialogInfo: function (text, btn1, btn2, btn1Back, icon, btn2Back) {
				let self = this;
				let iconIn = "";
				if (!icon) {
					iconIn = "";
				} else {
					iconIn = icon;
				}
				let html = `
	        	        <div class="dialog-content" id="dialog-content_` + self.getNewId + `">
	        	            <i class="f7-icons dialog-close-rdsp">close</i>
	        	            <div class="dialog-icon"><img src="` + iconIn + `" /></div>
	        	            <div class="dialog-text-rdsp">` + text + `</div>
	        	            <div class="btn_1">` + btn1 + `</div>
	        	            <div class="btn_2">` + btn2 + `</div>
	        	        </div>
	        	    `;
				openLayer(html, (el) => {
					jQuery("#dialog-content_" + self.getNewId + " .btn_1").off().click(function (event) {
						if (btn1Back) {
							btn1Back();
						}
					});
					jQuery("#dialog-content_" + self.getNewId + " .btn_2").off().click(function (event) {
						if (btn2Back) {
							btn2Back();
						}
						layer.closeAll();
					});
					jQuery("#dialog-content_" + self.getNewId + " .dialog-close-rdsp").off().click(function (event) {
						layer.closeAll();
					});
				}, "tips-dialog");
			},
			quitGetTaskEnd: function (endId) {
				let self = this;
				Dao.endEmergencyPlanRecords({
					userName: userInfor.accountName,
					deviceId: appKeyObj.deviceId,
					account: userInfor.accountName,
					planRecordId: endId,
				}, function (data) {
					jQuery("#emergencyTab_" + self.getNewId + ",#emergencyTabContent_" + self.getNewId).empty();
					self.getEmergencyData();
				});
			},
			drowBmap: function (lon, lat, dataId) {
				let self = this;
				let point = null;
				let parselon = JSON.parse(lon);
				let parselat = JSON.parse(lat);
				//百度地图显示
				this.planMap = new BMap.Map('drawBmap_' + dataId + '_' + self.getNewId, {
					enableMapClick: false //关闭底图可点功能
				});
				if (parselon != null && parselon != "" && parselon != undefined) {
					point = new BMap.Point(parselon, parselat);
				} else {
					point = new BMap.Point(117.830727, 30.484801);
				}
				let icon = new BMap.Icon('/ilink-app-h5-zd/static/img/rdspFile_1557407293967.png', new BMap.Size(35,
					55), {
					anchor: new BMap.Size(35, 55)
				});
				let marker = new BMap.Marker(point, {
					icon: icon
				});
				this.firePoint = point;
				this.planMap.centerAndZoom(point, 15); // 跳动的动画
				this.planMap.addOverlay(marker);
				this.planMap.enableScrollWheelZoom(); //允许缩放
			},
			fixFirePosition: function () {
				native.openNavigation(this.firePoint.lng, this.firePoint.lat);
				/* if (this.firePoint) {
					this.planMap.centerAndZoom(this.firePoint, 15); // 跳动的动画
				} */
			}
		},
		on: {
			pageInit: function (e, page) {
				let self = this;
				self.getEmergencyData();
				jQuery("#emergencyTabContent_" + self.getNewId + " img").off().click(function (e) {
					openAndShowBigImage([e.currentTarget.src], 0);
				});
			},
			pageBeforeRemove: function (e, page) {
				if (tempMap) {
					tempMap.dispose();
				}
			}
		}
	}
</script>